<?php
/* 
 * ********* CVS HEADER ********* 
 * 
 * $RCSfile: admfoncdroit.php,v $ 
 * $Date: 2005/10/21 12:58:07 $ 
 * $Revision: 1.3 $ 
 * 
 * ********* CVS HEADER ********* 
 */
include("environnement/$session[environnement]/header.php");
require_once(get_path_module("admin"));
$pc = new panneau_controle();
$pc->calculRubriqueParFonction('admfoncliste');
echo $pc->retourneEntete();
?>
<h1>Droits</h1><br>

<?php

$query="SELECT * FROM fonction WHERE id_fonction='$argid';";
$result=rportalrequete($query) or die ("ERREUR 0018");
$row=rportalligne($result);
echo "fonction : $row[code_op]<br>description : $row[description]<br><br>\n";
?>
<form method="post" action="?op=admfoncdroitmaj">
<input  type="hidden" name="id_menu" value="<?php echo $row[id_menu];?>">
<table>
  <tr>
<?php
echo "<input type=\"hidden\" name=\"idf\" value=\"$argid\">";
$query="SELECT id_groupe FROM droit WHERE id_fonction='$argid' ORDER BY id_groupe";
$result=rportalrequete($query) or die ("ERREUR 0019");
$query="SELECT * FROM groupe ORDER BY id";
$result2=rportalrequete($query) or die ("ERREUR 0020");
$row2=rportalligne($result);
while($row=rportalligne($result2))
{
	echo "<td>$row[nom]</td>\n<td>";
	if($row[id]==$row2[id_groupe])
	{
		echo "<input type=\"radio\" name=\"argid$row[id]\" value=\"0\" checked>oui \n";
		echo "<input type=\"radio\" name=\"argid$row[id]\" value=\"2\">non \n";
		$row2=rportalligne($result);
	}
	else
	{
		echo "<input type=\"radio\" name=\"argid$row[id]\" value=\"1\">oui \n";
		echo "<input type=\"radio\" name=\"argid$row[id]\" value=\"0\" checked>non \n";
	}
	echo "</td></tr>\n";
	
}
?>
<tr>
    <td>&nbsp;</td>
    <td>
        <input type="submit" name="Submit" value="Envoyer">
      </td>
  </tr>
</table>

<?php
include("environnement/$session[environnement]/footer.php");
?>